package com.totem.base.enums;

import lombok.Getter;

import java.util.Objects;

public enum SubscribeDaysEnum {
    SUBSCRIBE_1(1),
    SUBSCRIBE_7(7),
    SUBSCRIBE_15(15),
    SUBSCRIBE_30(30);

    @Getter
    private final int code;

    SubscribeDaysEnum(int code){
        this.code = code;
    }

    public static SubscribeDaysEnum byCode(int code) {
        for (SubscribeDaysEnum e: SubscribeDaysEnum.values()) {
            if (e.code==code) {
                return e;
            }
        }
        return null;
    }
}
